/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-04-22
 * Time: 22:50
 */
public class test2 {
    public void rotate(int[] nums, int k) {
        int n = nums.length;
        int[] newArr = new int[n];
        for(int i=0;i<n;i++){
            newArr[(i+k)%n] = nums[i];
        }
        // 转移回来
        for(int j = 0;j<n;j++){
            nums[j] = newArr[j];
        }
    }
}
